<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags"  prefix="s"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>财务分析</title>
    <script type="text/javascript" src="./javaScripts/calendar.js"></script>
    <link rel="stylesheet" type="text/css"	href="./styles/finance.css">
  </head>
  
  <body>
   		<div id="navigation">
   			当前位置: &nbsp; &nbsp;<a href="#">首页</a>&nbsp;&gt;&gt;&nbsp;<a href="finance/search.jsp">财务分析</a>&nbsp; &gt;&gt;&nbsp;
   			<a href="#request.modelURL">分红扩股</a>&nbsp;
   		</div>
   		<div id="mainContent">
			<table>
			<tr>
				<td width="120px" valign="top" id="leftbox">
					<ul id="leftUl">       
						<li><a href="finance/prepareNetGain">净利润</a></li>
						<li><a href="finance/preparePerProfit">每股收益</a></li>
						<li><a href="finance/prepareNetAsset">每股净资产</a></li>
						<li><a href="#">资产与负债</a></li>
						<li><a href="finance/prepareNetIncome">净资产收益率</a></li>
						<li><a href="finance/prepareMainProfit">主营业务利润</a></li>
						<li><a href="#">分红扩股</a></li>
						<li><a href="#">高级分析</a></li>
					</ul>
				</td>
				<td id="rightbox">
				<div id="searchBox">
					<div>
						<form action="finance/perProfit.action" method="post">
							<table align="center">
								<tr>
									<td>
										<s:date name="#attr.assistDto.startDate" format="yyyy-MM-dd" id="startDate" />
										<s:date name="#attr.assistDto.endDate" format="yyyy-MM-dd" id="endDate" />
										<s:set value="#attr.assistDto.rate" id="rate"></s:set>
										开始时间:<input type="text" name="assistDto.startDate" value ="${attr.startDate}" size="12" maxlength="12" onclick="calendar.show(this);" title="开始时间,格式为:年-月-日,比如：20000-1-1"/>
										&nbsp;&nbsp;到&nbsp;&nbsp;
										结束时间:<input type="text" name="assistDto.endDate" value ="${attr.endDate}" size="12" maxlength="12" onclick="calendar.show(this);" title="结束时间,格式为:年-月-日,比如：20000-1-1"/>
									</td>
								</tr>
								<tr>
									<td>
										<select name="assistDto.updown">
											<s:if test="#attr.assistDto.updown==1">
												<option value="1" selected="selected">上升</option>
												<option value="0">下降</option>
											</s:if>
											<s:else>
												<option value="1">上升</option>
												<option value="0" selected="selected">下降</option>
											</s:else>
											
										</select>
										<input type="text" name="assistDto.rate" value ="${attr.rate}" title="上升下降百分比,如：上升20%,输入20" size="12" maxlength="12"/>
										<input type="submit" value="查询"/>
									</td>
								</tr>
							</table>
						</form>
					</div>
				</div>
				<div id="resultList">
					<div class="page">
						<ul>  
							<s:iterator value="#attr.stockDTOList" status="status" step="1">
								<s:set name="priceearningList" value="#attr.stoPriceearningDTOList[#attr.status.getIndex()]" scope="request"/>
								<li>
									<div class="result">
									<s:if test="#status.isOdd()">
										<s:set name="className" value="'stockName odd'" var="className" scope="request"/>
									</s:if>
									<s:else>
										<s:set name="className" value="'stockName even'" var="className" scope="request"></s:set>
									</s:else>
										<div class="%{attr.className}">	
											◇<s:property value="stockCode"/> &nbsp;&nbsp;<a href="#"><s:property value="stockName"/> </a><br/>
										</div>
										<div class="stockReview">
											<table>
												<tr>
													<td width="40px"></td>
													<td>	<s:property value="stockCode"/>(<s:property value="stockName"/>)&nbsp;</td>
													<s:date name="#attr.listingDate" format="yyyy-MM-dd" id="lDate" />
													<td>	<s:property value="stockType"/>&nbsp;</td>
													<td>	<s:property value="lDate"/>上市&nbsp;</td>
													<td>	<s:property value="companyNameZh"/>&nbsp;&nbsp;</td>
													<td>	<s:property value="stockBoard"/>&nbsp;&nbsp;
												</tr>
											</table>
											<table>
												<tr>
													<td>	
														&nbsp;&nbsp;<s:property value="#attr.priceearningList.fieldYear"/>最新每股收益：&nbsp;&nbsp;
													</td>	
												</tr>
												<tr>
													<td>
														&nbsp;&nbsp;第一季度:<s:property value="#attr.priceearningList.firstQuarter"/>&nbsp;&nbsp;
														中期:<s:property value="#attr.priceearningList.metaphase"/>&nbsp; &nbsp;
														第三季度:<s:property value="#attr.priceearningList.thirdQuarter"/>&nbsp;  &nbsp;
														 <s:url id="url_more" value="/finance/perProfitDetail.action">
													         <s:param name="stockDTO.stockCode" value="stockCode"></s:param>
													     </s:url> 
														全年<s:property value="#attr.priceearningList.wholeYear"/>&nbsp;  &nbsp;
														<s:a href="%{url_more}">&gt;&gt;更多详细信息</s:a>
													</td>
												</tr>
											</table>
											
										</div> 
									</div>
								</li>     
							 </s:iterator>
						</ul>
					</div>
					 <s:if test="#attr.assistDto.totalPages gt 0">
					<div  class="pageNav">
						<!--define the url of the previous page and next page-->
					     <s:url id="url_index" value="/finance/perProfit.action">
					         <s:param name="assistDto.currentPages" value="1"></s:param>
					     </s:url>
					     <s:url id="url_pre" value="/finance/perProfit.action">
					         <s:param name="assistDto.currentPages" value="#attr.assistDto.currentPages-1"></s:param>
					     </s:url>
					     <s:url id="url_next" value="/finance/perProfit.action">
					         <s:param name="assistDto.currentPages" value="#attr.assistDto.currentPages+1"></s:param>
					     </s:url> 
					     <s:url id="url_end" value="/finance/perProfit.action">
					         <s:param name="assistDto.currentPages" value="#attr.assistDto.totalPages"></s:param>
					     </s:url> 
						<table align="center">
							<tr>
								<td>
									<s:if test="#attr.assistDto.currentPages==1">首页&nbsp;&nbsp;</s:if>
								 	<s:else><s:a href="%{url_index}">首页&nbsp;&nbsp;</s:a></s:else>
								</td>
								<td>
									<s:if test="#attr.assistDto.currentPages > 1">
										<s:a href="%{url_pre}">上一页&nbsp;&nbsp;</s:a>
									</s:if>
									<s:else>上一页&nbsp;&nbsp;</s:else>
								</td>
								<td>第${attr.assistDto.currentPages} 页&nbsp;&nbsp;</td>
								<td>
									<s:if test="#attr.assistDto.currentPages != #attr.assistDto.totalPages">
										<s:a href="%{url_next}">下一页&nbsp;&nbsp;</s:a>
									</s:if>
									<s:else>下一页&nbsp;&nbsp;</s:else>
								</td>
								<td>
									<s:if test="#attr.assistDto.currentPages == #attr.assistDto.totalPages">尾页&nbsp;&nbsp;</s:if>
									<s:else>
										<s:a href="%{url_end}">尾页&nbsp;&nbsp;</s:a> 
									</s:else>
								</td>
								<td>
									   共${attr.assistDto.totalPages}页 &nbsp;&nbsp;
								</td> 
							</tr>
						</table>
					</div>
					</s:if>	
				</div>
				</td>
			</tr>
		</table>
	</div>	
  </body>
</html>
